<template>
  <el-drawer title="项目详情" v-model="drawerVisible" size="60%">
    <el-scrollbar>
      <el-descriptions :column="1" direction="vertical" border>
        <el-descriptions-item label="项目编号"
          >{{ detail?.no }}
        </el-descriptions-item>
        <el-descriptions-item label="项目名称">
          {{ detail?.name }}
        </el-descriptions-item>
        <el-descriptions-item label="指导老师">
          {{ detail?.teacherName || "-" }}
        </el-descriptions-item>
        <el-descriptions-item label="项目简介">
          {{ detail?.proDescription || "-" }}
        </el-descriptions-item>
        <el-descriptions-item label="项目要求">
          {{ detail?.proRequirement || "-" }}
        </el-descriptions-item>
      </el-descriptions>
    </el-scrollbar>
  </el-drawer>
</template>

<script lang="ts" setup>
import { ref, reactive, computed, watch } from "vue";
import api from "@/api";
const drawerVisible = ref(false);
const detail = ref<any>(null);
watch(drawerVisible, (bool) => {
  if (!bool) {
  }
});

const open = (row: any) => {
  if (row) {
    api.project.selectCourseListByID(row.id).then((res: any) => {
      detail.value = res.data;
    });
  }

  drawerVisible.value = true;
};

defineExpose({ open });
</script>
